**********************************************************************
IPs
**********************************************************************

There are 168 IPs in Lufia 2. Most of their properties are stored in 
what I call the "IP Compendium".

-----------------------------------------------------------------------
IP data - the "IP Compendium"
-----------------------------------------------------------------------

[$021110, $02125F]:  pointers to data at [$021260]
                     (2 bytes, little-endian (i.e. "least significant 
                                                    byte first"))

                     336 bytes => 168 pointers.
                     Add $018200 to the pointers to find the offsets
                     of the IP Compendium "entries".

                     Example:
                     [$021110 -> $021111]: $60 90
                     => pointer: $9060
                     => offset: $9060 + $018200 = $021260
                     => The first IP Compendium entry starts 
                        at offset [$021260]

[$021260, $021D3D]:  "IP Compendium"

                     168 entries:
                     [$021260]:  Repeat attack
                     [$021274]:  Iron kick
                     ...
                     [$021D17]:  Double slash
                     [$021D2A]:  Ancient power

- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - 
Format of the IP Compendium entries:
- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - 

  6 "properties bytes" 
+ a variable number of "name bytes" 
+ 1 "end byte" ($00)


Start offset of the IP Compendium entry = offset [+$0000]

- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - 
"Properties bytes":
- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - 

  Bytes 0 and 1:    Effect
  Byte 2:           Animation
  Byte 3:           Targeting cursor
  Byte 4:           Targeting mode
  Byte 5:           IP cost

[+$0000, +$0001]
Bytes 0 and 1: Effect

        Number of the L2BASM subroutine that implements the IP 
        (2 bytes, little-endian).

        Example:
        - Bytes 0 and 1 of the 'Buster attack' IP:
          $1B 00 => effect number $001B

        Note that several IPs can have the same effect number. 
        In that case, it's the L2BASM scripts of the items 
        corresponding to these IPs that determine their actual 
        effect.

        Example:
        'Flame return', 'Thunderturn', 'Aqua mirror', ... 
        all have the effect number $005C.
        The actual effect of these IPs (return a given type of 
        attacks back against enemy for a short period) is 
        determined by the L2BASM scripts of the corresponding 
        items ('Agony helm' for 'Flame return', 'Boom turban' 
        for 'Thunderturn', ...).

                          - - - - - - - - - - - 

[+$0002]
Byte 2: Animation

        The number of the animation displayed when you use the IP 
        (the animation can sometimes be determined by the IP effect 
        L2BASM script though).

                          - - - - - - - - - - - 

[+$0003]
Byte 3: Targeting cursor

        The cursor displayed when you have to select the characters 
        or monsters who will be affected by the IP.

        $00 => "menu hand" (not used for IPs)
        $01 => sword (for attack IPs)
        $02 => staff (for spell IPs)
        $03 => pouch (for items, not used for IPs)
        $04 => "change arrow" (the cursor used when 
               you rearrange your party)
        ...
        $FF => the targeting cursor is invisible

                          - - - - - - - - - - - 

[+$0004]
Byte 4: Targeting mode

        $00 => You can't / don't have to target
               (IP affects all enemies, all allies or the user only)

        $01 => You must target one or several allies

        $02 => You must target one (and only one) ally

        $81 => You must target one or several enemies
 
        $82 => You must target one (and only one) enemy

        !!! This byte does not affect the effect of the IP
            (if an IP is designed to attack all enemies, it 
            will attack them all even if you set this byte 
            to $02 or anything else)

                          - - - - - - - - - - - 

[+$0005]
Byte 5: IP cost

        $00 => 0 %
        ...
        $FF => 100 %

- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - 
"Name bytes"
- - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - 

[+$0005, ...]
The name of the IP. The length is variable: $00 indicates the end of 
the name bytes, and the end of the IP compendium entry.

-----------------------------------------------------------------------
IP descriptions
-----------------------------------------------------------------------

[$0B8662, $0B87B3]:  pointers to IP descriptions
                     (2 bytes, little-endian)

[$0B87B4, $0BB2A0]:  item / spell / IP descriptions

The IP descriptions are compressed.

-----------------------------------------------------------------------
IP effects
-----------------------------------------------------------------------

[$0AF3EF, $0AF508]:  pointers to data at [$0AF509]
                     (2 bytes, little-endian)

                     282 bytes => 141
                     Add $0AF3EF to the pointers to find the offsets
                     of the L2BASM scripts for IP effects.

[$0AF509, $0AFC5A]:  L2BASM scripts for IP effects.

Each L2BASM script is preceeded by $FF.

***************************************************************************

***************************************************************************

           ************************************************
            "Lufia 2: Rise of the Sinistrals" (US version) 
                           IP data format
           ************************************************

                       Last update: 2004/10/09

                 by relnqshd (bernardalgain@yahoo.fr)
